#include "infolog.h"
#include <QVBoxLayout>
#include <QTime>

LogWidget* LogWidget::pinstance = 0;

LogWidget* LogWidget::instance(){
    if(pinstance==0){
        pinstance = new LogWidget;
    }
    return pinstance;
}


LogWidget::LogWidget(QWidget *parent): QWidget(parent){
    QLayout* layout = new QVBoxLayout;
    browser = new QTextBrowser;
    browser->insertPlainText(QString("Log started...\n"));
    layout->addWidget(browser);
    setLayout(layout);
}

void LogWidget::log(QString &string){
	browser->insertPlainText(QTime::currentTime().toString() + " " + string + "\n");
}

LogWidget::~LogWidget(){
}



